'\" te
.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH ATOMIC_BITS 3C "Mar 13, 2016"
.SH NAME
atomic_bits, atomic_set_long_excl, atomic_clear_long_excl \- atomic set and
clear bit operations
.SH SYNOPSIS
.LP
.nf
#include <atomic.h>

\fBint\fR \fBatomic_set_long_excl\fR(\fBvolatile ulong_t *\fR\fItarget\fR, \fBuint_t\fR \fIbit\fR);
.fi

.LP
.nf
\fBint\fR \fBatomic_clear_long_excl\fR(\fBvolatile ulong_t *\fR\fItarget\fR, \fBuint_t\fR \fIbit\fR);
.fi

.SH DESCRIPTION
.LP
The \fBatomic_set_long_excl()\fR and \fBatomic_clear_long_excl()\fR functions
perform an exclusive atomic bit set or clear operation on \fItarget\fR. The
value of \fIbit\fR specifies the number of the bit to be modified within
target. Bits are numbered from zero to one less than the maximum number of bits
in a \fBlong\fR. If the value of bit falls outside of this range, the result of
the operation is undefined.
.SH RETURN VALUES
.LP
The \fBatomic_set_long_excl()\fR and \fBatomic_clear_long_excl()\fR functions
return 0 if \fIbit\fR was successfully set or cleared. They return -1 if
\fIbit\fR was already set or cleared.
.SH ERRORS
.LP
No errors are defined.
.SH ATTRIBUTES
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Stable
_
MT-Level	MT-Safe
.TE

.SH SEE ALSO
.LP
.BR atomic_add (3C),
.BR atomic_and (3C),
.BR atomic_cas (3C),
.BR atomic_dec (3C),
.BR atomic_inc (3C),
.BR atomic_ops (3C),
.BR atomic_or (3C),
.BR atomic_swap (3C),
.BR membar_ops (3C),
.BR attributes (7)
